package com.taofuxn.yycreazy.util;

import android.content.Context;
import android.graphics.Bitmap;
import android.provider.MediaStore;
import android.util.Log;

import java.io.File;
import java.io.FileNotFoundException;

/**
 * 系统图库
 * Created by Wong on 2018/1/30.
 */
public class GalleryUtils {

    /**
     * 将图片保存到系统相册
     *
     * @param vContext 上下文
     * @param vFile
     * @throws FileNotFoundException
     */
    public static void saveImageToGallery(Context vContext, File vFile) throws FileNotFoundException {
        if (null == vFile || !vFile.exists()) {
            Log.d("GalleryUtils", "File to save Image to Gallery ,due to file is null");
        }

        MediaStore.Images.Media.insertImage(vContext.getContentResolver(),
                vFile.getAbsolutePath(), vFile.getName(), null);
    }


    /**
     * 刷新系统相册
     */
    public static void reflashGallery() {
    }


}
